home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 7 / Amiga Format AFCD07 (Dec 1996, Issue 91).iso / serious / shareware / programming / aros / utility / getuniqueid.c < prev    next >
C/C++ Source or Header  |  1996-09-12  |  1KB  |  69 lines

  1. /*
  2.     (C) 1995 AROS - The Amiga Replacement OS
  3.     $Id: getuniqueid.c,v 1.3 1996/09/12 14:52:47 digulla Exp $
  4.     $Log: getuniqueid.c,v $
  5.     Revision 1.3  1996/09/12 14:52:47  digulla
  6.     Better way to separate public and private parts of the library base
  7.  
  8.     Revision 1.2  1996/08/31 12:58:12  aros
  9.     Merged in/modified for FreeBSD.
  10.  
  11.     Desc:
  12.     Lang: english
  13. */
  14. #include "utility_intern.h"
  15.  
  16. /*****************************************************************************
  17.  
  18.     NAME */
  19.     #include <clib/utility_protos.h>
  20.  
  21.     __AROS_LH0(ULONG, GetUniqueID,
  22.  
  23. /*  SYNOPSIS */
  24.     /* void */
  25.  
  26. /*  LOCATION */
  27.     struct UtilityBase *, UtilityBase, 45, Utility)
  28.  
  29. /*  FUNCTION
  30.     Returns a unique id that is different from any other id that is
  31.     obtained from this function call.
  32.  
  33.     INPUTS
  34.  
  35.     RESULT
  36.     an unsigned long id
  37.  
  38.     NOTES
  39.  
  40.     EXAMPLE
  41.  
  42.     BUGS
  43.  
  44.     SEE ALSO
  45.  
  46.     INTERNALS
  47.     Calls Disable()/Enable() to guarentee uniqueness.
  48.  
  49.     HISTORY
  50.     29-10-95    digulla automatically created from
  51.                 utility_lib.fd and clib/utility_protos.h
  52.     17-08-96    iaint   Reimplemented. CVS lost my old one. Well I did.
  53.  
  54. *****************************************************************************/
  55. {
  56.     __AROS_FUNC_INIT
  57.     ULONG ret;
  58.  
  59.     Disable();
  60.  
  61.     ret = ++(GetIntUtilityBase(UtilityBase)->ub_LastID);
  62.  
  63.     Enable();
  64.  
  65.     return ret;
  66.  
  67.     __AROS_FUNC_EXIT
  68. } /* GetUniqueID */
  69.